blob: e8c2e578e979dd2a0dadca933f579ad0bc0cb06a [file] [log] [blame]
Howard Hinnantbc8d3f92010-05-11 19:42:161// -*- C++ -*-
2//===-------------------------- cerrno ------------------------------------===//
3//
Howard Hinnantf5256e12010-05-11 21:36:014// The LLVM Compiler Infrastructure
Howard Hinnantbc8d3f92010-05-11 19:42:165//
Howard Hinnantb64f8b02010-11-16 22:09:026// This file is dual licensed under the MIT and the University of Illinois Open
7// Source Licenses. See LICENSE.TXT for details.
Howard Hinnantbc8d3f92010-05-11 19:42:168//
9//===----------------------------------------------------------------------===//
10
11#ifndef _LIBCPP_CERRNO
12#define _LIBCPP_CERRNO
13
14/*
15 cerrno synopsis
16
17Macros:
18
19 EDOM
20 EILSEQ // C99
21 ERANGE
22 errno
23
24*/
25
26#include <__config>
27#include <errno.h>
28
29#pragma GCC system_header
30
31#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
32
Howard Hinnant8c1aa2c2011-04-10 19:46:5533#ifdef ELAST
34
Howard Hinnantbc8d3f92010-05-11 19:42:1635const int __elast1 = ELAST+1;
36const int __elast2 = ELAST+2;
Howard Hinnant8c1aa2c2011-04-10 19:46:5537
38#else
39
40const int __elast1 = 104;
41const int __elast2 = 105;
42
43#endif
Howard Hinnantbc8d3f92010-05-11 19:42:1644
45#ifdef ENOTRECOVERABLE
46
47#define EOWNERDEAD __elast1
Howard Hinnant8c1aa2c2011-04-10 19:46:5548
49#ifdef ELAST
50#undef ELAST
Howard Hinnantbc8d3f92010-05-11 19:42:1651#define ELAST EOWNERDEAD
Howard Hinnant8c1aa2c2011-04-10 19:46:5552#endif
Howard Hinnantbc8d3f92010-05-11 19:42:1653
54#elif defined(EOWNERDEAD)
55
56#define ENOTRECOVERABLE __elast1
Howard Hinnant8c1aa2c2011-04-10 19:46:5557#ifdef ELAST
58#undef ELAST
Howard Hinnantbc8d3f92010-05-11 19:42:1659#define ELAST ENOTRECOVERABLE
Howard Hinnant8c1aa2c2011-04-10 19:46:5560#endif
Howard Hinnantbc8d3f92010-05-11 19:42:1661
Howard Hinnant324bb032010-08-22 00:02:4362#else // defined(EOWNERDEAD)
Howard Hinnantbc8d3f92010-05-11 19:42:1663
64#define EOWNERDEAD __elast1
65#define ENOTRECOVERABLE __elast2
Howard Hinnant8c1aa2c2011-04-10 19:46:5566#ifdef ELAST
67#undef ELAST
Howard Hinnantbc8d3f92010-05-11 19:42:1668#define ELAST ENOTRECOVERABLE
Howard Hinnant8c1aa2c2011-04-10 19:46:5569#endif
Howard Hinnantbc8d3f92010-05-11 19:42:1670
Howard Hinnant324bb032010-08-22 00:02:4371#endif // defined(EOWNERDEAD)
Howard Hinnantbc8d3f92010-05-11 19:42:1672
Howard Hinnant324bb032010-08-22 00:02:4373#endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
Howard Hinnantbc8d3f92010-05-11 19:42:1674
75#endif // _LIBCPP_CERRNO